/* ==========================================================================
   $BASE-DATE-PICKER
   ========================================================================== */

/**
 * The picker box.
 */

.picker__box {
  padding: 0;
  overflow: hidden;
  border-radius: $datepicker-box-padding;

  /**
   * The header containing the month and year stuff.
   */
  .picker__header {
    position: relative;
    margin-bottom: $datepicker-header-mb;
    text-align: center;

    select {
      display: inline-block !important;
    }

    .picker__date-display {
      display: flex;
      justify-content: center;
      padding-bottom: .3125rem;
      font-weight: 400;
      background-color: $datepicker-date-bg;
      // color: #fff !important;
      @extend .white-text !optional;

      .picker__weekday-display {
        padding: .875rem .4375rem .3125rem .5rem;
        margin-top: 1.25rem;
        font-size: 2.1rem;
        letter-spacing: $datepicker-weekday-display-letter-spacing;
      }

      .picker__month-display {
        padding: .875rem .3125rem .25rem;
        margin-top: 1.25rem;
        font-size: 2.1rem;
      }

      .picker__day-display {
        padding: .875rem .3125rem .25rem;
        margin-top: 1.25rem;
        font-size: 2.1rem;
      }

      .picker__year-display {
        position: absolute;
        top: .625rem;
        left: 45%;
        font-size: 1.1rem;
        color: $datepicker-year;
      }
    }

    /**
       * The month and year labels.
       */
    .picker__month,
    .picker__year {
      display: inline-block;
      margin-right: $datepicker-year-mr;
      margin-left: $datepicker-year-ml;
    }

    /**
       * The month and year selectors.
       */
    .picker__select--month,
    .picker__select--year {
      display: inline-block;
      height: $datepicker-select-month-height;
      padding: 0;
      margin-right: $datepicker-select-month-mr;
      margin-left: $datepicker-select-month-ml;
      background: transparent;
      border: none;
      border-bottom: 1px solid #ced4da;
      outline: 0;

      &:focus {
        border-color: $datepicker-focus;
      }
    }

    .picker__select--year {
      width: $datepicker-select-year;
    }

    // Modified
    .picker__select--month.browser-default {
      display: inline;
      width: $datepicker-select-month-browser-width;
      // background-color: #fff !important;
      @extend .white !optional;
    }

    .picker__select--year.browser-default {
      display: inline;
      width: $datepicker-select-year-browser-width;
      // background-color: #fff !important;
      @extend .white !optional;
    }

    /**
       * The month navigation buttons.
       */
    .picker__nav--prev,
    .picker__nav--next {
      position: absolute;
      box-sizing: content-box;
      padding: .1875rem .625rem;

      &:hover {
        color: $black-base;
        cursor: pointer;
      }

      &:before {
        display: block;
        font-family: "Font Awesome 5 Free", sans-serif;
        font-weight: 900;
      }
    }

    .picker__nav--prev {
      left: -.5em;
      padding-right: $datepicker-nav-prev-pr;

      &:before {
        content: "\f104";
      }
    }

    .picker__nav--next {
      right: -.2em;
      padding-left: $datepicker-nav-next-pf;

      &:before {
        content: "\f105";
      }
    }

    .picker__nav--disabled,
    .picker__nav--disabled:hover,
    .picker__nav--disabled:before,
    .picker__nav--disabled:before:hover {
      cursor: default;
      background: none;
      border-right-color: $grey-lighten-4;
      border-left-color: $grey-lighten-4;
    }

  }

  /**
   * The calendar table of dates
   */
  .picker__table {
    width: $datepicker-table-width;
    margin-top: $datepicker-table-mt;
    margin-bottom: $datepicker-table-mb;
    font-size: $datepicker-table-font-size;
    text-align: center;
    table-layout: fixed;
    border-spacing: 0;
    border-collapse: collapse;

    th,
    td {
      text-align: center;
    }

    td {
      padding: 0;
      margin: 0;
    }

    /**
       * The weekday labels
       */
    .picker__weekday {
      width: $datepicker-table-weekday-width;
      padding-bottom: $datepicker-table-weekday-padding-bottom;
      font-size: $datepicker-table-weekday-font-size;
      font-weight: $datepicker-table-weekday-font-weight;
      color: $datepicker-color-mdb;

      /* Increase the spacing a tad */
      @media (min-height: $pickerweekday-padb-breakpoint) {
        padding-bottom: $datepicker-table-weekday-padding-bottom;
      }
    }

    /**
       * The days on the calendar
       */
    .picker__day--today {
      position: relative;
      padding: $datepicker-table-day-today-py 0;
      font-weight: $datepicker-table-day-today-font-weight;
      letter-spacing: $datepicker-table-day-today-letter-spacing;
      border: $datepicker-table-day-today-border solid transparent;
    }

    .picker__day.picker__day--today {
      color: $datepicker-selected;
    }

    .picker__day--disabled {
      &:before {
        border-top-color: #aaa;
      }
    }

    .picker__day--infocus {
      padding: $datepicker-table-day-infocus-py 0;
      font-weight: $datepicker-table-day-infocus-font-weight;
      color: $datepicker-table-day-infocus-color;
      letter-spacing: $datepicker-table-day-infocus-letter-spacing;
      border: $datepicker-table-day-infocus-color transparent;

      &:hover {
        font-weight: $datepicker-table-day-infocus-hover-font-weight;
        color: $black;
        cursor: pointer;
      }
    }

    .picker__day--outfocus {
      display: none;
      padding: $datepicker-table-day-outfocus-py 0;
      // color: #fff !important;
      @extend .white-text !optional;

      &:hover {
        font-weight: $datepicker-table-day-outfocus-hover-font-weight;
        color: $datepicker-table-day-outfocus-hover-color;
        cursor: pointer;
      }
    }

    .picker__day--highlighted:hover,
    .picker--focused .picker__day--highlighted {
      cursor: pointer;
    }

    .picker__day--selected,
    .picker__day--selected:hover,
    .picker--focused {
      background-color: $datepicker-selected;
      //  Circle background
      border-radius: $datepicker-table-day-selected-hover-border-radius;
      box-shadow: $z-depth-1-half;
      transform: $datepicker-table-day-selected-hover-transform;

      &.picker__day--outfocus {
        background-color: $datepicker-selected-outfocus;
      }

      // color: #fff !important;
      @extend .white-text !optional;
    }

    .picker__day--disabled,
    .picker__day--disabled:hover,
    .picker--focused {
      color: $datepicker-table-day-outfocus-hover-color;
      cursor: default;
      background: $grey-lighten-4;
      border-color: $grey-lighten-4;
    }

    .picker__day--highlighted.picker__day--disabled,
    .picker__day--highlighted.picker__day--disabled:hover {
      background: $datepicker-table-day-higlighted-color;
    }

  }

  /**
   * The footer containing the "today", "clear", and "close" buttons.
   */
  .picker__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: $datepicker-footer-py $datepicker-footer-px;
    text-align: right;

    .picker__button--today,
    .picker__button--clear,
    .picker__button--close {
      display: inline-block;
      width: $datepicker-footer-today-clear-button-width;
      padding: $datepicker-footer-today-clear-button-padding;
      font-size: $datepicker-footer-today-clear-button-font-size;
      font-weight: $datepicker-footer-today-clear-button-font-weight;
      text-transform: uppercase;
      vertical-align: bottom;
      background: $white;
      border: $datepicker-footer-today-clear-button-border solid $white;

      &:hover {
        color: $black;
        cursor: pointer;
        background: $datepicker-footer-today-clear-button-hover-color;
        border-bottom-color: $datepicker-footer-today-clear-button-hover-color;
      }

      &:focus {
        background: $datepicker-footer-today-clear-button-hover-color;
        border-color: $datepicker-focus;
        outline: none;
      }

      &:before {
        position: relative;
        display: inline-block;
        height: 0;
      }
    }

    .picker__button--today,
    .picker__button--clear {
      &:before {
        margin-right: $datepicker-footer-today-clear-button-before-mr;
        content: " ";
      }
    }

    .picker__button--today {
      &:before {
        top: $datepicker-footer-today-button-before-top;
        width: 0;
        border-top: $datepicker-footer-today-button-before-bt solid $datepicker-footer-today-button-before-bt-color;
        border-left: $datepicker-footer-today-button-before-bl solid transparent;
      }
    }

    .picker__button--clear {
      &:before {
        top: $datepicker-footer-clear-button-before-top;
        width: $datepicker-footer-clear-button-before-width;
        border-top: $datepicker-footer-clear-button-before-bl solid $datepicker-footer-clear-button-before-bt-color;
      }
    }

    .picker__button--close {
      &:before {
        top: $datepicker-footer-close-button-before-top;
        margin-right: $datepicker-footer-close-button-before-mr;
        font-size: $datepicker-footer-close-button-before-font-size;
        color: $datepicker-footer-close-button-before-color;
        vertical-align: top;
        content: "\D7";
      }
    }

    .picker__button--today[disabled],
    .picker__button--today[disabled]:hover {
      color: $datepicker-table-day-outfocus-hover-color;
      cursor: default;
      background: $grey-lighten-4;
      border-color: $grey-lighten-4;
    }

    .picker__button--today[disabled]:before {
      border-top-color: #aaa;
    }
  }

}

/* ==========================================================================
   CUSTOM MATERIALIZE STYLES
   ========================================================================== */

.picker__calendar-container {
  padding: $datepicker-calender-padding;

  thead {
    border: none;
  }
}
